import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const inits = []
// 把modules文件下的 js文件返回出来

const store = new Vuex.Store({
  state: { 
	  count: 0,
	  count1: 10,
	  count2: 20,
	  count3: 30,
	     todos: [
	        { id: 1, text: '...', done: true },
	        { id: 2, text: '...', done: false }
	      ]
  },
  getters:{
	    doneTodos: (state,num) => {
	        return state.todos.filter(todo => todo.done)
	    }
  },
  mutations: {
    increment (state) {
		console.log(114)
      state.count++
	  console.log(state.count)
    },
	 decrement: state => state.count--
	  
  }
})
export default store